<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>3D</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        body {
            background-image: url(../img/beijing.jpg);
            background-size: cover;
            background-repeat: repeat;
        }

        .box {
            position: relative;
            width: 250px;
            height: 250px;
            margin: 150px auto;
            transform-style: preserve-3d;
            transform: rotateX(40deg) rotateY(-31deg);
        }

        .box>div {
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            text-align: center;
            line-height: 250px;
            font-size: 150px;
        }

        .left {
            background: #ace8ff;
            transform: translateX(-125px) rotateY(90deg);
        }

        .right {
            background: #e2fa69;
            transform: translateX(125px) rotateY(90deg);
        }

        .forward {
            background: #f9e19f;
            transform: translateZ(125px);
        }

        .back {
            background: burlywood;
            transform: translateZ(-125px);
        }

        .up {
            background: #f08b4c;
            transform: translateY(-125px) rotateX(90deg);
        }

        .down {
            background: #cd96fa;
            transform: translateY(125px) rotateX(90deg);
        }
    </style>
</head>

<body>
    <div class="box">
        <div class="up">上</div>
        <div class="down">下</div>
        <div class="left">左</div>
        <div class="right">右</div>
        <div class="forward">前</div>
        <div class="back">后</div>
    </div>
</body>

</html>